package com.aqie.meet.helper;

import com.aqie.libfactory.model.api.RspModel;
import com.aqie.libfactory.net.Network;
import com.aqie.libfactory.net.RemoteService;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class AppStartHelper {
    public static void statistics(String type){
        RemoteService service = Network.remote();
        Call<RspModel<Boolean>> call = service.userStatistics(type);
        call.enqueue(new Callback<RspModel<Boolean>>() {
            @Override
            public void onResponse(Call<RspModel<Boolean>> call, Response<RspModel<Boolean>> response) {
                RspModel<Boolean> body = response.body();
                if(response.code() == 401){
                    return;
                }
                if(body !=null && body.success()){
                    if(type.equals("1")){
                        //BaseApplication.showToast("app启动");
                    }else {
                        //BaseApplication.showToast("app退出");
                    }
                }
            }

            @Override
            public void onFailure(Call<RspModel<Boolean>> call, Throwable t) {

            }
        });
    }
}
